/*
 * Copyright (c) 2009-2013 EvTech Project
 * All rights reserved.
 * 
 * This file is part of Symbol Matching.
 *
 * Symbol Matching is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 *
 * Symbol Matching is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Symbol Matching.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package fi.honkalampisaatio.reaktiopeli.xml;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import fi.honkalampisaatio.game.xml.FontData;
import fi.honkalampisaatio.game.xml.GameSettings;

@XmlRootElement(namespace = "fi.honkalampisaatio.gamesettings")
public class ReactionGameSettings extends GameSettings {
	private String gameType;
	private GameDifficulty gameDifficulty;
	private int waitTime;
	private String instruction;
	private String correctAnswerImage;
	private ArrayList<ChoiceButton> choiceButtons;
	private ArrayList<Question> questions;
	private boolean showScore = true;
	private boolean omitMistakes = true;
	private FontData fontData;
	private FontData questionsFontData;

	public void setGameType(String gameType) {
		this.gameType = gameType;
	}

	@XmlElement(name = "pelityyppi")
	public String getGameType() {
		return gameType;
	}


	public void setGameDifficulty(GameDifficulty gameDifficulty) {
		this.gameDifficulty = gameDifficulty;
	}

	@XmlElement(name = "valinta-aika")
	public GameDifficulty getGameDifficulty() {
		if(gameDifficulty==null) {
			gameDifficulty = new GameDifficulty();
		}
		return gameDifficulty;
	}

	public void setWaitTime(int waitTime) {
		this.waitTime = waitTime;
	}

	@XmlElement(name = "odotusaika")
	public int getWaitTime() {
		return waitTime;
	}

	public void setInstruction(String instruction) {
		this.instruction = instruction;
	}

	@XmlElement(name = "ohje")
	public String getInstruction() {
		return instruction;
	}

	public void setCorrectAnswerImage(String correctAnswerImage) {
		this.correctAnswerImage = correctAnswerImage;
	}

	@XmlElement(name = "oikeinkuva")
	public String getCorrectAnswerImage() {
		return correctAnswerImage;
	}

	public void setChoiceButtons(ArrayList<ChoiceButton> choiceButtons) {
		this.choiceButtons = choiceButtons;
	}

	// XmLElementWrapper generates a wrapper element around XML representation
	@XmlElementWrapper(name = "valintapainikkeet")
	// XmlElement sets the name of the entities
	@XmlElement(name = "painike")
	public ArrayList<ChoiceButton> getChoiceButtons() {
		return choiceButtons;
	}

	public void setQuestions(ArrayList<Question> questions) {
		this.questions = questions;
	}

	// XmLElementWrapper generates a wrapper element around XML representation
	@XmlElementWrapper(name = "kysymykset")
	// XmlElement sets the name of the entities
	@XmlElement(name = "valinta")
	public ArrayList<Question> getQuestions() {
		return questions;
	}


	public void setShowScore(boolean showScore) {
		this.showScore = showScore;
	}
	

	@XmlElement(name = "naytapisteet")
	public boolean isShowScore() {
		return showScore;
	}

	public void setOmitMistakes(boolean omitMistakes) {
		this.omitMistakes = omitMistakes;
	}

	@XmlElement(name = "ohitavirhevalinnat")
	public boolean isOmitMistakes() {
		return omitMistakes;
	}

	// XmlElement sets the name of the entities
	@XmlElement(name = "yleisfontti")
	public FontData getFontData() {
		return fontData;
	}
	public void setFontData(FontData fontData) {
		this.fontData = fontData;
	}

	// XmlElement sets the name of the entities
	@XmlElement(name = "kysymysfontti")
	public FontData getQuestionsFontData() {
		return questionsFontData;
	}
	public void setQuestionsFontData(FontData questionsFontData) {
		this.questionsFontData = questionsFontData;
	}
	
	public String toString()
	{
		return name;
	}
}
